// 项目库
import request from '@/utils/request'

// 1 项目库分页接口
export function apiLibraryPage(params) {
  return request({
    url: '/xm/project/library/page',
    method: 'get',
    jy: true,
    params
  })
}

// 2 登记项目需求
export function apiSaveLibrary(data) {
  return request({
    url: `/xm/project/library/saveLibrary`,
    method: 'post',
    data,
    jy: true
  })
}

// 3 删除项目库
export function apiDelLibrary(libraryId) {
  return request({
    url: `/xm/project/library/deleteLibrary/${libraryId}`,
    method: 'get',
    jy: true
  })
}

// 3 获取项目库数据详情
export function apiGetDetails(libraryId) {
  return request({
    url: `/xm/project/library/getDetails/${libraryId}`,
    method: 'get',
    jy: true
  })
}

// 4 修改项目库信息
export function apiUpdateLibrary(data) {
  return request({
    url: `/xm/project/library/updateLibrary`,
    method: 'put',
    data,
    jy: true
  })
}

// 5 查看项目库中删除的数据--草稿
export function apiPageCraft() {
  return request({
    url: `/xm/project/library/pageCraft`,
    method: 'get',
    jy: true
  })
}

// 6 草稿删除
export function apiDeleteCraft(ids) {
  return request({
    url: `/xm/project/library/deleteCraft/${ids}`,
    method: 'delete',
    jy: true
  })
}

// 7 草稿修改后提交
export function apiCraftUpdateAndSubmit(libraryId) {
  return request({
    url: `/xm/project/library/updateAndSubmit/${libraryId}`,
    method: 'put',
    jy: true
  })
}
